package org.exez.modules.system.constant;

/**
 * 操作类型
 *
 * @author dtm
 */
public enum OperateTypeEnum {
    GET("查询", 1),
    SAVE("添加", 2),
    UPDATE("编辑", 3),
    DELETED("删除", 4),
    IN_EXPORT("导入", 5),
    ON("导出", 6);
    private String name;
    private Integer index;

    private OperateTypeEnum(String name, Integer index) {
        this.name = name;
        this.index = index;
    }

    public static String getName(Integer index) {
        for (OperateTypeEnum c : OperateTypeEnum.values()) {
            if (c.getIndex().equals(index)) {
                return c.name;
            }
        }
        return null;
    }



    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getIndex() {
        return index;
    }

    public void setIndex(Integer index) {
        this.index = index;
    }

}
